***********************************************************************
* Is Terrorism Necessarily Violent? Public Perceptions of Nonviolence * 
* and Terrorism in Conflict Settings      							  *
*                                                                     *
* Avishay Ben Sasson-Gordis & Alon Yakter  							  *
* Political Science Research and Methods (2023)		  				  *
*                                                                     *
* Replication code - Israeli experiment            					  * ***********************************************************************
* The analysis was performed with Stata 17. 						  *
*																	  *
* To load the data (the "use" command), users should place the .dta	  *
* file in their Stata working directory (or type the full file 		  *
* paths as saved on their computer).                      			  *
***********************************************************************

**********************************************
* installing necessary user-written packages *
**********************************************
ssc install estout, replace
ssc install grstyle, replace
ssc install mplotoffset, replace
net install grc1leg2.pkg, from (http://digital.cgdev.org/doc/stata/MO/Misc/) replace

*****************************
* Load Israeli data 		*
*****************************
use "BSG & Yakter PSRM - Israel survey-experiment data.dta", replace

*******************************
* Descriptive plot (Figure 1) *
*******************************
grstyle init
grstyle set legend, nobox
grstyle set plain, nogrid box
graph bar (percent), ///
	over(is_terror, gap(*0.5) nolab) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	text(50 1 "Mean=7.77", place(e) size(medlarge)) text(46 1 "S.D.=2.73", place(e) size(medlarge)) ///
	title("Denotation") name(is_terror_bar, replace)
graph bar (percent), ///
	over(is_illegitimate, gap(*0.5) nolab) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	text(50 1 "Mean=8.06", place(e) size(medlarge)) text(46 1 "S.D.=2.6", place(e) size(medlarge)) ///
	title("Illegitimacy") name(is_illegitimate_bar, replace)
graph bar (percent), ///
	over(use_force, gap(*0.5) nolab) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	text(50 1 "Mean=7.92", place(e) size(medlarge)) text(46 1 "S.D.=2.66", place(e) size(medlarge)) ///
	title("Use of Force") name(use_force_bar, replace)
graph combine is_terror_bar is_illegitimate_bar use_force_bar, ///
	col(3) ycommon 	xsize(3) ysize(1) scale(1.8)
graph export Figure1.pdf

**************************************
* Influence of action type (Table 2) *
**************************************
eststo clear
qui eststo: reg is_terror i.tr_nonviolence attention
qui eststo: reg is_terror i.tr_action attention
qui eststo: reg is_illegitimate i.tr_nonviolence attention
qui eststo: reg is_illegitimate i.tr_action attention
qui eststo: reg use_force i.tr_nonviolence attention
qui eststo: reg use_force i.tr_action attention
esttab using Table2.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(1.tr_action 0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_nonviolence 2.tr_action 3.tr_action 4.tr_action attention) ///
	coeflabels(1.tr_nonviolence Nonviolence ///
		2.tr_action Economic_action 3.tr_action Legal_action 4.tr_action Construct_action /// 
		attention Attention _cons Constant-Violence) ///
	mgroups("Terror Denotation" "Illegitimacy" "Use Force", pattern(1 0 1 0 1 0)) ///
	mtitles("Violence" "Action" "Violence" "Action" "Violence" "Action") 
* wald tests for action type by harm
qui reg is_terror i.tr_action attention
test i2.tr_action = i3.tr_action
test i2.tr_action = i4.tr_action
test i3.tr_action = i4.tr_action
qui reg is_illegitimate i.tr_action attention
test i2.tr_action = i3.tr_action
test i2.tr_action = i4.tr_action
test i3.tr_action = i4.tr_action
qui reg use_force i.tr_action attention
test i2.tr_action = i3.tr_action
test i2.tr_action = i4.tr_action
test i3.tr_action = i4.tr_action

*****************************************************
* Influence of action type - by ideology (Figure 2) *
*****************************************************
grstyle init
grstyle set legend, nobox
grstyle set plain, nogrid box
qui reg is_terror i.tr_nonviolence##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Denotation", size(large)) ///
	name(terror_violence_pv, replace)
qui reg is_illegitimate i.tr_nonviolence##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_violence_pv, replace)
qui reg use_force i.tr_nonviolence##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Use of Force", size(large)) ///
	name(force_violence_pv, replace)
grc1leg2 terror_violence_pv legitimate_violence_pv force_violence_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Vote by Partisan Bloc", size(medsmall)) ///
	l1title("Predicted Values",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_violence, replace)
graph export Figure2.pdf

***********************************
* Influence of labeling (Table 3) *
***********************************
eststo clear
qui eststo: reg is_terror i.tr_frame attention if tr_nonviolence==1
qui eststo: reg is_illegitimate i.tr_frame attention if tr_nonviolence==1
qui eststo: reg use_force i.tr_frame attention if tr_nonviolence==1
esttab using Table3.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_frame attention) ///
	coeflabels(1.tr_frame Terror-Label attention Attention _cons Constant-No_Label) ///
	mtitles("Terror Denotation" "Legitimacy" "Use Force") 
		
**************************************************
* Influence of labeling - by ideology (Figure 3) *
**************************************************
qui reg is_terror i.tr_frame##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Denotation", size(large)) ///
	name(terror_label_pv, replace)
qui reg is_illegitimate i.tr_frame##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_label_pv, replace)
qui reg use_force i.tr_frame##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Use of Force", size(large)) ///
	name(force_label_pv, replace)
grc1leg2 terror_label_pv legitimate_label_pv force_label_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Vote by Partisan Bloc", size(medsmall)) ///
	l1title("Predicted Values",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_label, replace)
graph export Figure3.pdf

*******************************************
* Appendix: Sample tests and descriptives *
*******************************************
* balance tests by demography (Table A2)
* note: Stata orders the table columns differently, we have reordered them manually in the appendix.
****************************************
eststo clear
qui eststo: mlogit treatment_group i.sex i.region i.agegr i.edu i.relid i.vote_bloc_rcl i.attention, b(2)
esttab using TableA2.rtf, ///
	b(3) unstack nogaps noomitted not label noobs drop(1* 0* _cons)

* power analysis (scores used for Table A3)
*******************************************
retrodesign 0.3 0.5 1 1.5, se(0.15) alpha(0.05) df(245)

* descriptive stats 
*******************
* summary stats (scores used for Table C1)
summarize is_terror is_illegitimate use_force attention i.vote_bloc_rcl if is_terror!=.
* distribution graphs (Figure C1)
graph bar (percent), ///
	over(is_terror, gap(*0.5) nolab) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	title("Denotation") name(is_terror_bar, replace)
graph bar (percent), ///
	over(is_illegitimate, gap(*0.5) nolab) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	title("Illegitimacy") name(is_illegitimate_bar, replace)
graph bar (percent), ///
	over(use_force, gap(*0.5) nolab) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	title("Use of Force") name(use_force_bar, replace)
graph bar (percent), ///
	over(vote_bloc_rcl, gap(*0.5) relabel(1 "Left" 2 "Center" 3 "Right" 4 `""Not" "Voted""')) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	title("Vote by Partisan Bloc") name(vote_bloc_rcl_bar, replace)
graph bar (percent), ///
	over(attention, gap(*0.5) relabel(1 `""Failed" "Check""' 2 `""Passed" "Check""')) ///
	bar(1 ,color(black)) ytitle("Percent") ylabel(,nogrid) ///
	title("Attention Check") name(attention_bar, replace)
graph combine is_terror_bar is_illegitimate_bar use_force_bar vote_bloc_rcl_bar attention_bar, ///
	col(3) ycommon
graph export FigureC1.pdf

***************************************
* Appendix: full models behind graphs *
***************************************
* violence vs nonviolence interacted with partisanship (Table D1)
eststo clear
qui eststo: reg is_terror i.tr_nonviolence##i.vote_bloc_rcl attention if vote_bloc_rcl!=4
qui eststo: reg is_illegitimate i.tr_nonviolence##i.vote_bloc_rcl attention if vote_bloc_rcl!=4
qui eststo: reg use_force i.tr_nonviolence##i.vote_bloc_rcl attention if vote_bloc_rcl!=4
esttab using TableD1.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(1.vote_bloc_rcl 1.tr_nonviolence#1.vote_bloc_rcl 0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_nonviolence 2.vote_bloc_rcl 3.vote_bloc_rcl 1.tr_nonviolence#2.vote_bloc_rcl ///
		1.tr_nonviolence#3.vote_bloc_rcl attention) ///
	coeflabels(1.tr_nonviolence Nonviolence 2.vote_bloc_rcl Center 3.vote_bloc_rcl Right ///
		1.tr_nonviolence#2.vote_bloc_rcl NonviolenceXCenter 1.tr_nonviolence#3.vote_bloc_rcl ///
		NonviolenceXRight attention Attention _cons Constant-Violence-Left) ///
	mtitles("Terror Denotation" "Illegitimacy" "Use Force") 
	
* terror label interacted with partisanship (Table D2)
eststo clear
qui eststo: reg is_terror i.tr_frame##i.vote_bloc_rcl attention if vote_bloc_rcl!=4 & tr_nonviolence==1
qui eststo: reg is_illegitimate i.tr_frame##i.vote_bloc_rcl attention if vote_bloc_rcl!=4 & tr_nonviolence==1
qui eststo: reg use_force i.tr_frame##i.vote_bloc_rcl attention if vote_bloc_rcl!=4 & tr_nonviolence==1
esttab using TableD2.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(1.vote_bloc_rcl 1.tr_frame#1.vote_bloc_rcl 0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_frame 2.vote_bloc_rcl 3.vote_bloc_rcl 1.tr_frame#2.vote_bloc_rcl ///
		1.tr_frame#3.vote_bloc_rcl attention) ///
	coeflabels(1.tr_frame Terror_Label 2.vote_bloc_rcl Center 3.vote_bloc_rcl Right ///
		1.tr_frame#2.vote_bloc_rcl Terror_LabelXCenter 1.tr_frame#3.vote_bloc_rcl ///
		Terror_LabelXRight attention Attention _cons Constant-No_Label-Left) ///
	mtitles("Terror Denotation" "Illegitimacy" "Use Force")

* logit analysis for substantive implications of framing effect (Table D3)
eststo clear
qui eststo: logit force_hi_dummy i.tr_frame##i.vote_bloc_rcl attention if vote_bloc_rcl!=4 & tr_nonviolence==1
esttab using TableD3.rtf, ///
	b(3) se(3) scalars(r2_p) nogaps compress nomtitles nodepvars ///
	drop(1.vote_bloc_rcl 1.tr_frame#1.vote_bloc_rcl 0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_frame 2.vote_bloc_rcl 3.vote_bloc_rcl 1.tr_frame#2.vote_bloc_rcl ///
		1.tr_frame#3.vote_bloc_rcl attention) ///
	coeflabels(1.tr_frame Terror_Label 2.vote_bloc_rcl Center 3.vote_bloc_rcl Right ///
		1.tr_frame#2.vote_bloc_rcl Terror_LabelXCenter 1.tr_frame#3.vote_bloc_rcl ///
		Terror_LabelXRight attention Attention _cons Constant-No_Label-Left) 
* post-estimaiton predicted probabilities (scores used for Table D4)
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))

******************************
* Appendix: robustness tests *
******************************
* adding demographic controls
*****************************
* action and harm - regression (Table E1)
eststo clear
qui eststo: reg is_terror i.tr_nonviolence attention sex agegr i.relid edu oleh i.region  
qui eststo: reg is_terror i.tr_action attention sex agegr i.relid edu oleh i.region 
qui eststo: reg is_illegitimate i.tr_nonviolence attention sex agegr i.relid edu oleh i.region 
qui eststo: reg is_illegitimate i.tr_action attention sex agegr i.relid edu oleh i.region 
qui eststo: reg use_force i.tr_nonviolence attention sex agegr i.relid edu oleh i.region 
qui eststo: reg use_force i.tr_action attention sex agegr i.relid edu oleh i.region 
esttab using TableE1.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(1.tr_action 1.relid 1.region 0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_nonviolence 2.tr_action 3.tr_action 4.tr_action attention) ///
	coeflabels(1.tr_nonviolence Nonviolence ///
		2.tr_action Economic_action 3.tr_action Legal_action 4.tr_action construct_action /// 
		1.attention Attention _cons Constant-Violence sex Gender-Female agegr Age-Group ///
		2.relid Religious-Id-Traditional 3.relid Religious-Id-Religious 4.relid ///
		Religious-Id-Haredi edu Education oleh Immigrant 2.region Region-North 3.region Region-Haifa ///
		4.region Region-Center 5.region Region-Tel-Aviv 6.region Region-South 7.region Region-West-Bank) ///
	mgroups("Terror Denotation" "Illegitimacy" "Use Force", pattern(1 0 1 0 1 0)) ///
	mtitles("Violence" "Action" "Violence" "Action" "Violence" "Action") 
* action and harm - hetereognous effects, predicted value graphs (Figure E1)
	qui reg is_terror i.tr_nonviolence##i.vote_bloc_rcl i.attention sex agegr i.relid edu oleh i.region if vote_bloc_rcl!=4
	margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
	mplotoffset, recast(scatter) ///
		plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
		plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
		legend(order(3 "Violence" 4 "Non-violence" )) ///
		yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
		xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
		ytitle("") 	xtitle("")  ///
		yline(5.5, lpattern(dash) lcolor(gr6)) ///
		title("Denotation", size(large)) ///
		name(terror_violence_pv, replace)
	qui reg is_illegitimate i.tr_nonviolence##i.vote_bloc_rcl i.attention sex agegr i.relid edu oleh i.region if vote_bloc_rcl!=4
	margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
	mplotoffset, recast(scatter) ///
		plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
		plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
		legend(order(3 "Violence" 4 "Non-violence" )) ///
		yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
		xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
		ytitle("") 	xtitle("")  ///
		yline(5.5, lpattern(dash) lcolor(gr6)) ///
		title("Illegitimacy", size(large)) ///
		name(legitimate_violence_pv, replace)
	qui reg use_force i.tr_nonviolence##i.vote_bloc_rcl i.attention sex agegr i.relid edu oleh i.region if vote_bloc_rcl!=4
	margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
	mplotoffset, recast(scatter) ///
		plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
		plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
		legend(order(3 "Violence" 4 "Non-violence" )) ///
		yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
		xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
		ytitle("") 	xtitle("")  ///
		yline(5.5, lpattern(dash) lcolor(gr6)) ///
		title("Use of Force", size(large)) ///
		name(force_violence_pv, replace)
	grc1leg2 terror_violence_pv legitimate_violence_pv force_violence_pv ///
		, rows(1) xcommon ycommon labsize(small) ///
		b2title("Vote by Partisan Bloc", size(medsmall)) ///
		l1title("Predicted Values",  size(medsmall)) ring(2) ///
		xsize(6) ysize(3) scale(1.4) ///
		name(combine_violence, replace)
	graph export FigureE1.pdf
* labeling - regression (Table E2)
eststo clear
qui eststo: reg is_terror i.tr_frame attention sex agegr i.relid edu oleh i.region if tr_nonviolence==1
qui eststo: reg is_illegitimate i.tr_frame attention sex agegr i.relid edu oleh i.region if tr_nonviolence==1
qui eststo: reg use_force i.tr_frame attention sex agegr i.relid edu oleh i.region if tr_nonviolence==1
esttab using TableE2.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(0* 1.relid 1.region) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_frame attention) ///
	coeflabels(1.tr_frame Terror-Label attention Attention _cons Constant-No_Label ///
		sex Gender-Female agegr Age-Group ///
		2.relid Religious-Id-Traditional 3.relid Religious-Id-Religious 4.relid ///
		Religious-Id-Haredi edu Education oleh Immigrant 2.region Region-North 3.region Region-Haifa ///
		4.region Region-Center 5.region Region-Tel-Aviv 6.region Region-South 7.region Region-West-Bank) ///
	mtitles("Terror Denotation" "Illegitimacy" "Use Force")
* labeling - hetereognous effects, predicted value graphs (Figure E2)
qui reg is_terror i.tr_frame##i.vote_bloc_rcl i.attention sex agegr i.relid edu oleh i.region if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Denotation", size(large)) ///
	name(terror_label_pv, replace)
qui reg is_illegitimate i.tr_frame##i.vote_bloc_rcl i.attention sex agegr i.relid edu oleh i.region if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_label_pv, replace)
qui reg use_force i.tr_frame##i.vote_bloc_rcl i.attention sex agegr i.relid edu oleh i.region if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Use of Force", size(large)) ///
	name(force_label_pv, replace)
grc1leg2 terror_label_pv legitimate_label_pv force_label_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Vote by Partisan Bloc", size(medsmall)) ///
	l1title("Predicted Values", size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_label, replace)
graph export FigureE2.pdf
	
* controlling for perceived speaker partisanship
************************************************
* action and harm - regression (Table E3)
eststo clear
qui eststo: reg is_terror i.tr_nonviolence attention speaker_ideology  
qui eststo: reg is_terror i.tr_action attention speaker_ideology 
qui eststo: reg is_illegitimate i.tr_nonviolence attention speaker_ideology 
qui eststo: reg is_illegitimate i.tr_action attention speaker_ideology 
qui eststo: reg use_force i.tr_nonviolence attention speaker_ideology 
qui eststo: reg use_force i.tr_action attention speaker_ideology 
esttab using TableE3.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(1.tr_action 0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_nonviolence 2.tr_action 3.tr_action 4.tr_action attention) ///
	coeflabels(1.tr_nonviolence Nonviolence ///
		2.tr_action Economic_action 3.tr_action Legal_action 4.tr_action construct_action /// 
		attention Attention _cons Constant-Violence speaker_ideology Speaker-Ideology) ///
	mgroups("Terror Denotation" "Illegitimacy" "Use Force", pattern(1 0 1 0 1 0)) ///
	mtitles("Violence" "Action" "Violence" "Action" "Violence" "Action") 
* action and harm - hetereognous effects, predicted value graphs (Figure E3)
qui reg is_terror i.tr_nonviolence##i.vote_bloc_rcl i.attention speaker_ideology if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Denotation", size(large)) ///
	name(terror_violence_pv, replace)
qui reg is_illegitimate i.tr_nonviolence##i.vote_bloc_rcl i.attention speaker_ideology if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_violence_pv, replace)
qui reg use_force i.tr_nonviolence##i.vote_bloc_rcl i.attention speaker_ideology if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(2 10)) ylabel(2(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Use of Force", size(large)) ///
	name(force_violence_pv, replace)
grc1leg2 terror_violence_pv legitimate_violence_pv force_violence_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Vote by Partisan Bloc", size(medsmall)) ///
	l1title("Predicted Values",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_violence, replace)
graph export FigureE3.pdf
* labeling - regression (Table E4)
eststo clear
qui eststo: reg is_terror i.tr_frame attention speaker_ideology if tr_nonviolence==1
qui eststo: reg is_illegitimate i.tr_frame attention speaker_ideology if tr_nonviolence==1
qui eststo: reg use_force i.tr_frame attention speaker_ideology if tr_nonviolence==1
esttab using TableE4.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_frame attention) ///
	coeflabels(1.tr_frame Terror-Label attention Attention _cons Constant-No_Label ///
		speaker_ideology Speaker-Ideology) ///
	mtitles("Terror Denotation" "Legitimacy" "Use Force") 
* labeling - hetereognous effects, predicted value graphs (Figure E4)
qui reg is_terror i.tr_frame##i.vote_bloc_rcl i.attention speaker_ideology if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Denotation", size(large)) ///
	name(terror_label_pv, replace)
qui reg is_illegitimate i.tr_frame##i.vote_bloc_rcl i.attention speaker_ideology if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_label_pv, replace)
qui reg use_force i.tr_frame##i.vote_bloc_rcl i.attention speaker_ideology if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(5 10)) ylabel(5(2)10, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(5.5, lpattern(dash) lcolor(gr6)) ///
	title("Use of Force", size(large)) ///
	name(force_label_pv, replace)
grc1leg2 terror_label_pv legitimate_label_pv force_label_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Vote by Partisan Bloc", size(medsmall)) ///
	l1title("Predicted Values",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_label, replace)
graph export FigureE4.pdf

* heterogeneous effects with longer l-r scale (squared)
*******************************************************
* action and harm - hetereognous effects, predicted value graphs (Figure E5)
qui reg is_terror i.tr_nonviolence##c.rl_id##c.rl_id i.attention 
margins, dydx(tr_nonviolence) at(rl_id=(1(1)7)) 
marginsplot, ///
	xlabel(, format(%9.0g) labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(0, lcolor(gs10)) ///
	plotopts(mcolor(black) lcolor(black)) ciopts(lcolor(black)) ///
	title("Denotation", size(large)) ///
	name(terror_violence_pv, replace)
qui reg is_illegitimate i.tr_nonviolence##c.rl_id##c.rl_id i.attention 
margins, dydx(tr_nonviolence) at(rl_id=(1(1)7)) 
marginsplot, ///
	xlabel(, format(%9.0g) labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(0, lcolor(gs10)) ///
	plotopts(mcolor(black) lcolor(black)) ciopts(lcolor(black)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_violence_pv, replace)
qui reg use_force i.tr_nonviolence##c.rl_id##c.rl_id i.attention 
margins, dydx(tr_nonviolence) at(rl_id=(1(1)7)) 
marginsplot, ///
	xlabel(, format(%9.0g) labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(0, lcolor(gs10)) ///
	plotopts(mcolor(black) lcolor(black)) ciopts(lcolor(black)) ///
	title("Use of Force", size(large)) ///
	name(force_violence_pv, replace)
grc1leg2 terror_violence_pv legitimate_violence_pv force_violence_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Ideological Self-identification (Right to Left)", size(medsmall)) ///
	l1title("Marginal Effect of Nonviolent Action",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_violence, replace) loff
graph export FigureE5.pdf
* labeling - hetereognous effects, predicted value graphs (Figure E6)
qui reg is_terror i.tr_frame##c.rl_id##c.rl_id i.attention if tr_nonviolence==1
margins, dydx(tr_frame) at(rl_id=(1(1)7)) 
marginsplot, ///
	xlabel(, format(%9.0g) labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(0, lcolor(gs10)) ///
	plotopts(mcolor(black) lcolor(black)) ciopts(lcolor(black)) ///
	title("Denotation", size(large)) ///
	name(terror_label_pv, replace)
qui reg is_illegitimate i.tr_frame##c.rl_id##c.rl_id i.attention if tr_nonviolence==1
margins, dydx(tr_frame) at(rl_id=(1(1)7)) 
marginsplot, ///
	xlabel(, format(%9.0g) labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(0, lcolor(gs10)) ///
	plotopts(mcolor(black) lcolor(black)) ciopts(lcolor(black)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_label_pv, replace)
qui reg use_force i.tr_frame##c.rl_id##c.rl_id i.attention if tr_nonviolence==1
margins, dydx(tr_frame) at(rl_id=(1(1)7)) 
marginsplot, ///
	xlabel(, format(%9.0g) labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(0, lcolor(gs10)) ///
	plotopts(mcolor(black) lcolor(black)) ciopts(lcolor(black)) ///
	title("Use of Force", size(large)) ///
	name(force_label_pv, replace)
grc1leg2 terror_label_pv legitimate_label_pv force_label_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Ideological Self-identification (Right to Left)", size(medsmall)) ///
	l1title("Marginal Effect of Terror Label",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_label, replace) loff
graph export FigureE6.pdf

* collapsed DV scales
*********************
* generate collapsed scales:
foreach var of varlist is_terror is_illegitimate use_force {
	recode `var' (1/2 = 1)(3/4 = 2)(5/6 = 3)(7/8 = 4)(9/10 = 5), gen(`var'_5)
}
* action and harm - regression (Table E5)
eststo clear
qui eststo: reg is_terror_5 i.tr_nonviolence attention
qui eststo: reg is_terror_5 i.tr_action attention
qui eststo: reg is_illegitimate_5 i.tr_nonviolence attention
qui eststo: reg is_illegitimate_5 i.tr_action attention
qui eststo: reg use_force_5 i.tr_nonviolence attention
qui eststo: reg use_force_5 i.tr_action attention
esttab using TableE5.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(1.tr_action 0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_nonviolence 2.tr_action 3.tr_action 4.tr_action attention) ///
	coeflabels(1.tr_nonviolence Nonviolence ///
		2.tr_action Economic_action 3.tr_action Legal_action 4.tr_action Construct_action /// 
		1.attention Attention _cons Constant-Violence) ///
	mgroups("Terror Denotation" "Illegitimacy" "Use Force" pattern(1 0 1 0 1 0)) ///
	mtitles("Violence" "Action" "Violence" "Action" "Violence" "Action")
* action and harm - hetereognous effects, predicted value graphs (Figure E7)
qui reg is_terror_5 i.tr_nonviolence##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(1 5)) ylabel(1(1)5, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(3, lpattern(dash) lcolor(gr6)) ///
	title("Denotation", size(large)) ///
	name(terror_violence_pv, replace)
qui reg is_illegitimate_5 i.tr_nonviolence##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(1 5)) ylabel(1(1)5, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(3, lpattern(dash) lcolor(gr6)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_violence_pv, replace)
qui reg use_force_5 i.tr_nonviolence##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4
margins, at(vote_bloc_rcl=(1(1)3) tr_nonviolence=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "Violence" 4 "Non-violence" )) ///
	yscale(range(1 5)) ylabel(1(1)5, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(3, lpattern(dash) lcolor(gr6)) ///
	title("Use of Force", size(large)) ///
	name(force_violence_pv, replace)
grc1leg2 terror_violence_pv legitimate_violence_pv force_violence_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Vote by Partisan Bloc", size(medsmall)) ///
	l1title("Predicted Values",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_violence_5, replace)
graph export FigureE7.pdf
* labeling - regression (Table E6)
eststo clear
qui eststo: reg is_terror_5 i.tr_frame attention if tr_nonviolence==1
qui eststo: reg is_illegitimate_5 i.tr_frame attention if tr_nonviolence==1
qui eststo: reg use_force_5 i.tr_frame attention if tr_nonviolence==1
esttab using TableE6.rtf, ///
	b(3) se(3) r2(3) nogaps compress ///
	drop(0*) ///
	star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
	order(_cons 1.tr_frame attention) ///
	coeflabels(1.tr_frame Terror-Label attention Attention _cons Constant-No_Label) ///
	mtitles("Terror Denotation" "Legitimacy" "Use Force")
* labeling - hetereognous effects, predicted value graphs (Figure E8)
qui reg is_terror_5 i.tr_frame##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(1 5)) ylabel(1(1)5, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(3, lpattern(dash) lcolor(gr6)) ///
	title("Denotation", size(large)) ///
	name(terror_label_pv, replace)
qui reg is_illegitimate_5 i.tr_frame##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(1 5)) ylabel(1(1)5, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(3, lpattern(dash) lcolor(gr6)) ///
	title("Illegitimacy", size(large)) ///
	name(legitimate_label_pv, replace)
qui reg use_force_5 i.tr_frame##i.vote_bloc_rcl i.attention if vote_bloc_rcl!=4 & tr_nonviolence==1
margins, at(vote_bloc_rcl=(1(1)3) tr_frame=(0 1))
mplotoffset, recast(scatter) ///
	plot1opts(mcolor(black)) ci1opts(lcolor(black)) ///
	plot2opts(mcolor(black) msymbol(Oh)) ci2opts(lcolor(black)) ///
	legend(order(3 "No Label" 4 "Terror Label" )) ///
	yscale(range(1 5)) ylabel(1(1)5, labsize(medsmall)) ///
	xlabel(1 "Left" 2 "Center" 3 "Right", labsize(medsmall)) ///
	ytitle("") 	xtitle("")  ///
	yline(3, lpattern(dash) lcolor(gr6)) ///
	title("Use of Force", size(large)) ///
	name(force_label_pv, replace)
grc1leg2 terror_label_pv legitimate_label_pv force_label_pv ///
	, rows(1) xcommon ycommon labsize(small) ///
	b2title("Vote by Partisan Bloc", size(medsmall)) ///
	l1title("Predicted Values",  size(medsmall)) ring(2) ///
	xsize(6) ysize(3) scale(1.4) ///
	name(combine_label, replace)
graph export FigureE8.pdf